/*
 * @Author: JohnYang
 * @Date: 2020-09-25 21:31:03
 * @LastEditors: JohnYang
 * @LastEditTime: 2020-11-01 20:23:08
 */
import http from "@/utils/request";

import { importType } from "@/config";

export function getImportList({
  pageSize,
  pageNum,
  start,
  end,
  userName,
  region,
  frameNum,
  dealerName,
  contractNumber
}) {
  return http({
    url: "/index/index/list",
    method: "POST",
    data: {
      type: importType,
      pageSize: pageSize,
      offset: pageNum,
      start,
      end,
      userName,
      region,
      dealerName,
      frameNum,
      contractNumber
    }
  });
}

export function getImport(id) {
  return http({
    url: "/index/index/detail",
    method: "post",
    data: {
      id,
      type: importType
    }
  });
}

export function saveImport(model) {
  return http({
    url: "/index/index/save",
    method: "post",
    data: {
      ...model,
      type: importType
    }
  });
}

export function deleteImport(id) {
  return http({
    url: "/index/index/delete",
    method: "post",
    data: {
      id,
      type: importType
    }
  });
}
